/*******************************************************************************
 * Copyright (c) 2010 Mikhail Garber.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Lesser Public License (LGPL)
 * which accompanies this distribution
 * 
 * Contributors:
 *     Mikhail Garber - initial API and implementation
 ******************************************************************************/
package plumber.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * annotate method as participating in business-plumber orchestration
 * @author mgarber
 *
 */
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface PlumberFlow {
	/**
	 * @return name of the business Flow
	 */
	String flow();
	
	/**
	 * 
	 * @return name of the Step in the Flow
	 */
	String step();
	
	/**
	 * 
	 * @return array of outcomes for this Step
	 */
	Outcome[] outcomes() default {};
	
	/**
	 *
	 * @return maximum retry count for this Step
	 */
	int maxRetryCount() default 3;
	
	/**
	 * 
	 * @return maximum run time for this Step
	 */
	int maxRuntimeSeconds() default 5;
	
	/**
	 * 
	 * @return whether this Step is the first one in the Flow
	 */
	boolean firstStep() default false;
}
